package demo02;

import sun.java2d.cmm.kcms.CMM;

public class Computer implements USB{

    @Override
    public void Open() {
        System.out.println("打开电脑");
    }
    public void Choose(USB usb) {
        usb.Open();
        if(usb instanceof Mouse) {
            Mouse mouse = (Mouse) usb;
            mouse.Using();
        } else if(usb instanceof Keyboard) {
            Keyboard keyboard = (Keyboard)usb;
            keyboard.Play();
        }
        usb.Close();
    }
    @Override
    public void Close() {
        System.out.println("关闭电脑");
    }
}
